/*
 * @Author: 晴鸢. 3013433857@qq.com
 * @Date: 2025-10-15 16:48:19
 * @LastEditors: 晴鸢. 3013433857@qq.com
 * @LastEditTime: 2025-10-30 22:54:54
 * @FilePath: /Learn/tcp/main.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include"TcpServer.hpp"
#include<iostream>
#include<memory>
void Usage(std::string proc)
{
    std::cout<<"\nUsage:"<<proc<<" port[1024+]\n"<<std::endl;
}
//./tcpserver 8080
int main(int argc,char*argv[])
{
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(UsageError);
    }
    uint16_t port=std::stoi(argv[1]);
    std::unique_ptr<TcpServer> tcp_svr(new TcpServer(port,"192.168.232.200"));
    tcp_svr->Init();
    tcp_svr->Start();
    return 0;
}